package com.brtbeacon.wx.demo.mapview;

import android.Manifest;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.ActivityCompat;
import android.support.v7.app.AppCompatActivity;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    private EditText editURL;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        findViewById(R.id.btn_start).setOnClickListener(this);
        editURL = findViewById(R.id.edit_url);
    }

    @Override
    public void onClick(View v) {
        if (v.getId() == R.id.btn_start) {
            String url = editURL.getText().toString().trim();
            if (TextUtils.isEmpty(url)) {
                Toast.makeText(this, "请填写地图链接！", Toast.LENGTH_SHORT).show();
                return;
            }
            MapWebViewActivity.startActivity(this, url);
        }
    }

}
